<?php

class m110703_135414_create_office extends CDbMigration {

	protected $_tables = array(
		'office'=>array(
			'_id'=>'pk',
			'insertTime'=>'integer',
			'updateTime'=>'integer',
			'ownerId'=>'integer',
			'name'=>'string',
			'type'=>'string',
			'address'=>'text',
			'phones'=>'text',
			'emails'=>'text',
			'urls'=>'text',
			'ims'=>'text',
		),
	);

	protected $_indexes = array(
		'office'=>array(
			'name',
			'type',
		),
	);

	public function up() {
		foreach ($this->_tables as $key=>$value) {
			$this->createTable($key, $value);
		}
	}

	public function down() {
		foreach ($this->_tables as $key=>$value) {
			$this->dropTable($key);
		}
	}

}